home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update16.zoo / lib / diffc < prev    next >
Encoding:
Text File  |  1992-03-06  |  46.4 KB  |  2,092 lines

  1. *** 1.66    1992/02/04 17:11:06
  2. --- Changelo    1992/03/06 19:25:58
  3. ***************
  4. *** 2784,2786 ****
  5. --- 2784,2856 ----
  6.       sfp004 code and software floating point code merged into one file.
  7.   
  8.   ---------------------------- Patchlevel 75 ---------------------------
  9. + getopt.c, random.c, ctime.c:: michal
  10. +     get rid of dependency on doprnt().
  11. + random.c:: ++jrb
  12. +     warn about needing an ANSI pre-processor for str concat.
  13. + bcopy.s, memcpy.c:: ++jrb
  14. +     DELETE these files.
  15. + bcopy.s, memcpy.s:: michal
  16. +     replace with these. note now memcpy and memmove are NOT
  17. +      equivalenced. memmove will correctly handle overlap, while memcpy
  18. +      will not.
  19. + bcopy.s, memcpy.s:: ++jrb
  20. +     make the cnt check unsigned.
  21. + string.h:: ++jrb
  22. +     adjust protos for bXXXX() functions to size_t for counts.
  23. + mincl:: ++jrb
  24. +     adjust dependcy for memcpy()
  25. + memcpy.s:: ++jrb
  26. +     was missing label setup:
  27. + osbind.h:: michal
  28. +     Add new Waketime() binding for ST Book.
  29. + osbind.h:: Warwick@cs.uq.oz.au
  30. +     change cast for Kbdvbase() as g++ wont grok void (**)
  31. + ctype.[ch]:: ers/++jrb
  32. +     change _ctype[] back to pointer so that locales may switch pointers.
  33. +     keep andreas's changes for unsigned index into ctype in. that
  34. +     way EOF is covered too. (by the 0xff entry).
  35. + compiler.h file.h unistd.h assert.h ostruct.h:: ++jrb
  36. +     sync up with mntlib pl18 changes for soz etc.
  37. + bcmp.c, bzero.c, qsort.c: ers
  38. +     Ansification (casting lvalues is a no-no :-).
  39. + doprnt.c getcwd.c memccpy.c mkdir.c tmpnam.c fdopen.c
  40. + getenv.c memchr.c sbrk.c ftw.c memcmp.c sleep.c crt0.c
  41. + getbuf.c malloc.c memset.c sprintf.c strdup.c system.c sysvar.c:: ++jrb
  42. +     merge in soz portability changes as per mntlib 18
  43. + mkdir.c:: ++jrb
  44. +     check for existance before attempting to make per mntlib 18
  45. + doprnt.c:: ++jrb
  46. +     t was not being initialized in one case. do it at the top.
  47. + gnulib2.c:: ++jrb
  48. +     add support routines for gcc-2.0: note that the lib needs
  49. +     to be re-compiled BEFORE you try to compile gcc-2.0,
  50. +     otherwise you will end up chasing your tail!
  51. + ldexp.cpp: mjr++
  52. +     rewrote the sfp code.
  53. + doprnt.c: mjr++
  54. +     fixed my bug in the treatment of NaNs and Infinities. 
  55. + mktemp.c:: ++jrb
  56. +     make mktemp() more MiNT friendly by using pid when __mint.
  57. + ---------------------------- Patchlevel 76 ---------------------------
  58. *** 1.8    1992/02/04 17:11:06
  59. --- DMakefile    1992/03/06 19:25:58
  60. ***************
  61. *** 61,67 ****
  62.   difftime.c  fungetc.c    memccpy.c   screen.c    strncat.c   vfork.c    \
  63.   dirent.c    fwrite.c    memchr.c    setbuf.c    strncmp.c   write.c    \
  64.   div.c        getbuf.c    memcmp.c    setlocal.c    strncpy.c        \
  65. ! doprnt.c    getcwd.c    memcpy.c    setvbuf.c    strpbrk.c        \
  66.   dup.c        getenv.c    memset.c    sgtty.c    strrchr.c   device.c    \
  67.   pipe.c        binmode.c    timeoday.c
  68.   
  69. --- 61,67 ----
  70.   difftime.c  fungetc.c    memccpy.c   screen.c    strncat.c   vfork.c    \
  71.   dirent.c    fwrite.c    memchr.c    setbuf.c    strncmp.c   write.c    \
  72.   div.c        getbuf.c    memcmp.c    setlocal.c    strncpy.c        \
  73. ! doprnt.c    getcwd.c            setvbuf.c    strpbrk.c        \
  74.   dup.c        getenv.c    memset.c    sgtty.c    strrchr.c   device.c    \
  75.   pipe.c        binmode.c    timeoday.c
  76.   
  77. *** 1.51    1992/01/29 20:58:29
  78. --- PatchLev.h    1992/03/06 19:25:59
  79. ***************
  80. *** 1,5 ****
  81.   
  82. ! #define    PatchLevel "75"
  83.   
  84.   /*
  85.    *
  86. --- 1,5 ----
  87.   
  88. ! #define    PatchLevel "76"
  89.   
  90.   /*
  91.    *
  92. *** 1.9    1991/06/23 17:07:09
  93. --- bcmp.c    1992/03/06 19:26:09
  94. ***************
  95. *** 4,9 ****
  96. --- 4,10 ----
  97.   
  98.   #undef ODD
  99.   #define ODD(x) (((short)(x)) & 1)    /* word ops are faster */
  100. + #define INC(x, size) x = (const void *)(((const char *)(x)) + (size))
  101.   
  102.   /*
  103.    * compare n bytes efficientlty
  104. ***************
  105. *** 13,21 ****
  106.    *   ++jrb  bammi@dsrgsun.ces.cwru.edu
  107.    */
  108.   asm(".stabs \"_lbcmp\",5,0,0,_bcmp"); /* dept of clean tricks */
  109.   int bcmp(src, dst, n)
  110. ! const register void * src;
  111. ! const register void * dst;
  112.   register size_t n;
  113.   {
  114.       assert ((src != NULL) && (dst != NULL));
  115. --- 14,23 ----
  116.    *   ++jrb  bammi@dsrgsun.ces.cwru.edu
  117.    */
  118.   asm(".stabs \"_lbcmp\",5,0,0,_bcmp"); /* dept of clean tricks */
  119.   int bcmp(src, dst, n)
  120. ! const void * src;
  121. ! const void * dst;
  122.   register size_t n;
  123.   {
  124.       assert ((src != NULL) && (dst != NULL));
  125. ***************
  126. *** 27,34 ****
  127.       switch(ODD(src) + ODD(dst))
  128.       {
  129.         case 2: /* ODD ODD */
  130. !         if(*(char *)dst++ != *(char *)src++)
  131.           return 1;
  132.           n--;
  133.           /* fall thru */
  134.           
  135. --- 29,38 ----
  136.       switch(ODD(src) + ODD(dst))
  137.       {
  138.         case 2: /* ODD ODD */
  139. !         if (*(const char *)dst != *(const char *)src)
  140.           return 1;
  141. +             INC(src, 1);
  142. +         INC(dst, 1);
  143.           n--;
  144.           /* fall thru */
  145.           
  146. ***************
  147. *** 37,53 ****
  148.           n -= (l << 2);
  149.           w = (n >> 1); /* # of words */
  150.           n -= (w << 1); /* n == # of residual bytes */
  151. !         while(l--)
  152. !         if( *((long *)dst)++ != *((long *)src)++ )
  153. !             return 1;
  154. !         while(w--)
  155. !         if( *((short *)dst)++ != *((short *)src)++ )
  156.               return 1;
  157.           /* fall thru */
  158.         case 1: /* ODD/EVEN or EVEN/ODD */
  159. !         while(n--)
  160. !         if( *(char *)dst++ != *(char *)src++ )
  161.               return 1;
  162.       }
  163.       }
  164.        return 0;
  165. --- 41,66 ----
  166.           n -= (l << 2);
  167.           w = (n >> 1); /* # of words */
  168.           n -= (w << 1); /* n == # of residual bytes */
  169. !         while(l--) {
  170. !         if (*((const long *)dst) != *((const long *)src))
  171. !             return 1;
  172. !         INC(dst, sizeof(long));
  173. !         INC(src, sizeof(long));
  174. !         }
  175. !         while(w--) {
  176. !         if( *((const short *)dst) != *((const short *)src) )
  177.               return 1;
  178. +         INC(dst, sizeof(short));
  179. +         INC(src, sizeof(short));
  180. +         }
  181.           /* fall thru */
  182.         case 1: /* ODD/EVEN or EVEN/ODD */
  183. !         while(n--) {
  184. !         if( *(const char *)dst != *(const char *)src )
  185.               return 1;
  186. +         INC(dst, 1);
  187. +         INC(src, 1);
  188. +         }
  189.       }
  190.       }
  191.        return 0;
  192. *** 1.9    1991/06/23 17:07:09
  193. --- bzero.c    1992/03/06 19:26:11
  194. ***************
  195. *** 4,9 ****
  196. --- 4,10 ----
  197.   
  198.   #undef ODD
  199.   #define ODD(x) (((short)(x)) & 1)    /* word ops are faster */
  200. + #define INC(b, size) b = (void *)( ((char *)(b)) + (size) )
  201.   
  202.   /*
  203.    * zero out a chunk efficiently
  204. ***************
  205. *** 12,20 ****
  206.    *   ++jrb  bammi@dsrgsun.ces.cwru.edu
  207.    */
  208.   asm(".stabs \"_lbzero\",5,0,0,_bzero"); /* dept of clean tricks */
  209.   void bzero(b, n)
  210. ! register void * b;
  211. ! register size_t n;
  212.   {
  213.       register size_t l, w;
  214.       
  215. --- 13,22 ----
  216.    *   ++jrb  bammi@dsrgsun.ces.cwru.edu
  217.    */
  218.   asm(".stabs \"_lbzero\",5,0,0,_bzero"); /* dept of clean tricks */
  219.   void bzero(b, n)
  220. ! void * b;
  221. ! size_t n;
  222.   {
  223.       register size_t l, w;
  224.       
  225. ***************
  226. *** 22,28 ****
  227.       
  228.       if(ODD(b))
  229.       {
  230. !     *(char *)b++ = (char)0;
  231.       n--;
  232.       }
  233.   
  234. --- 24,31 ----
  235.       
  236.       if(ODD(b))
  237.       {
  238. !     *(char *)b = (char)0;
  239. !     INC(b, 1);
  240.       n--;
  241.       }
  242.   
  243. ***************
  244. *** 31,41 ****
  245.       w = (n >> 1); /* # of words */
  246.       n -= (w << 1); /* n == # of residual bytes */
  247.   
  248. !     while(l--)
  249. !     *((long *)b)++ = 0L;
  250. !     while(w--)
  251. !     *((short *)b)++ = (short)0;
  252. !     while(n--)
  253. !     *(char *)b++ = (char)0;
  254.   }
  255.   
  256. --- 34,50 ----
  257.       w = (n >> 1); /* # of words */
  258.       n -= (w << 1); /* n == # of residual bytes */
  259.   
  260. !     while(l--) {
  261. !     *((long *)b) = 0L;
  262. !     INC(b, sizeof(long));
  263. !     }
  264. !     while(w--) {
  265. !     *((short *)b) = (short)0;
  266. !     INC(b, sizeof(short));
  267. !     }
  268. !     while(n--) {
  269. !     *(char *)b = (char)0;
  270. !     INC(b, 1);
  271. !     }
  272.   }
  273.   
  274. *** 1.19    1992/02/04 17:11:06
  275. --- crt0.c    1992/03/06 19:26:13
  276. ***************
  277. *** 80,85 ****
  278. --- 80,86 ----
  279.   #ifndef _COMPILER_H
  280.   #include <compiler.h>
  281.   #endif
  282. + #include <stddef.h>
  283.   
  284.   #define isspace(c) ((c) == ' '||(c) == '\t')
  285.   #define BUFSIZ    ((unsigned long)1024)    /* this must track the value */
  286. ***************
  287. *** 112,118 ****
  288.   void *_heapbase;
  289.   
  290.   /* default sizeof stdio buffers */
  291. ! unsigned long __DEFAULT_BUFSIZ__;    /* .comm             */
  292.   
  293.   /* are we an app? */
  294.   short _app;
  295. --- 113,119 ----
  296.   void *_heapbase;
  297.   
  298.   /* default sizeof stdio buffers */
  299. ! size_t __DEFAULT_BUFSIZ__;    /* .comm             */
  300.   
  301.   /* are we an app? */
  302.   short _app;
  303. *** 1.6    1991/04/26 03:42:08
  304. --- ctime.c    1992/03/06 19:26:13
  305. ***************
  306. *** 13,18 ****
  307. --- 13,54 ----
  308.                           "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
  309.   
  310.   
  311. + #ifdef __GNUC__
  312. + /* 
  313. +  * macro to produce two decimal digits of mval and write them
  314. +  * at position pointed by mptr - moves mptr to the next free position;
  315. +  * mval has to be in range 0-99, or banshee will get you
  316. +  */
  317. + #define _TWODIG(mptr,mval)        \
  318. + {                    \
  319. +         long _i = (long)(mval);        \
  320. +      __asm__ volatile("
  321. +     extl    %1;
  322. +     divu    #10,%1;
  323. +     addb    #48,%1;
  324. +     moveb    %1,%0@+;
  325. +     swap    %1;
  326. +     addb    #48,%1;
  327. +     moveb    %1,%0@+"            \
  328. +           : "=a"((long)mptr)    \
  329. +           : "d"(_i), "g"((unsigned short)mval), \
  330. +             "0"(mptr));        \
  331. + }
  332. + #else
  333. + static char *
  334. + two_dig(char *buf, unsigned short num) {
  335. +     unsigned int rem;
  336. +     rem = num % 10;
  337. +     *buf++ = '0' + (num / 10);
  338. +     *buf++ = '0' + rem;
  339. +     return buf;
  340. + }
  341. + #endif /* __GNUC__ */
  342.   char *asctime(time)
  343.           register const struct tm *time;
  344.   /*
  345. ***************
  346. *** 20,34 ****
  347.    *      the same internal buffer, as for ctime() is used for this function.
  348.    */
  349.           {
  350. !     if (time == NULL)
  351. !          (void)strcpy(timebuf, "??? ??? ?? ??:??:?? ????\n");
  352. !     else
  353. !              (void)sprintf(timebuf, "%.3s %.3s%3d %02d:%02d:%02d %04d\n",
  354. !                 day[time->tm_wday], month[time->tm_mon], time->tm_mday,
  355. !                 time->tm_hour, time->tm_min, time->tm_sec, 1900+time->tm_year);
  356. !         return(timebuf);
  357.           }
  358.   
  359.   char *ctime(rawtime)
  360.           const time_t *rawtime;
  361.   /*
  362. --- 56,103 ----
  363.    *      the same internal buffer, as for ctime() is used for this function.
  364.    */
  365.           {
  366. !     unsigned short values[6], *vpos, *valp;
  367. !     int i;
  368. !     char * ptr = timebuf;
  369. !     
  370. !     (void)strcpy(ptr, "??? ??? ?? ??:??:?? ????\n");
  371. !     if (time != NULL)
  372. !         {
  373. !         vpos = values;
  374. !         *vpos++ = time->tm_mday;
  375. !         *vpos++ = time->tm_hour;
  376. !         *vpos++ = time->tm_min;
  377. !         *vpos++ = time->tm_sec;
  378. !         i = 1900 + time->tm_year;
  379. !         *vpos++ = i / 100;
  380. !         *vpos   = i % 100;
  381. !         ptr = memcpy(ptr, day[time->tm_wday], 3) + 3;
  382. !         ptr += 1;
  383. !         ptr = memcpy(ptr, month[time->tm_mon], 3) + 3;
  384. !         valp = values;
  385. !         do
  386. !         {
  387. !         ptr += 1;
  388. ! #ifdef __GNUC__
  389. !         _TWODIG(ptr, *valp++);
  390. ! #else
  391. !         ptr = two_dig(ptr, *valp++);
  392. ! #endif /* __GNUC__ */
  393. !         }
  394. !             while (valp < vpos);
  395. ! #ifdef __GNUC__
  396. !         _TWODIG(ptr, *valp);
  397. ! #else
  398. !         ptr = two_dig(ptr, *valp);
  399. ! #endif /* __GNUC__ */
  400. !         if ('0' == timebuf[8])
  401. !         timebuf[8] = ' ';    /* blank out leading zero on a day */
  402. !         }
  403. !     return(timebuf);
  404.           }
  405.   
  406.   char *ctime(rawtime)
  407.           const time_t *rawtime;
  408.   /*
  409. ***************
  410. *** 35,41 ****
  411.    *      Convert <rawtime> to a string.  A 26 character fixed field string
  412.    *      is created from the raw time value.  The following is an example
  413.    *      of what this string might look like:
  414. !  *              "Wed Jul 08 18:43:07 1987\n\0"
  415.    *      A 24-hour clock is used, and due to a limitation in the ST system
  416.    *      clock value, only a resolution of 2 seconds is possible.  A pointer
  417.    *      to the formatted string, which is held in an internal buffer, is
  418. --- 104,110 ----
  419.    *      Convert <rawtime> to a string.  A 26 character fixed field string
  420.    *      is created from the raw time value.  The following is an example
  421.    *      of what this string might look like:
  422. !  *              "Wed Jul  8 18:43:07 1987\n\0"
  423.    *      A 24-hour clock is used, and due to a limitation in the ST system
  424.    *      clock value, only a resolution of 2 seconds is possible.  A pointer
  425.    *      to the formatted string, which is held in an internal buffer, is
  426. *** 1.6    1992/01/29 20:58:29
  427. --- ctype.c    1992/03/06 19:26:13
  428. ***************
  429. *** 12,18 ****
  430.           /* some code uses these as function pointers --  i   */
  431.           /* have seen code that does.                 */
  432.   
  433. ! unsigned char _ctype[UCHAR_MAX+1] =
  434.       {
  435.       _CTc, _CTc, _CTc, _CTc,                /* 0x00..0x03 */
  436.       _CTc, _CTc, _CTc, _CTc,                /* 0x04..0x07 */
  437. --- 12,18 ----
  438.           /* some code uses these as function pointers --  i   */
  439.           /* have seen code that does.                 */
  440.   
  441. ! static unsigned char _myctype[UCHAR_MAX+1] =
  442.       {
  443.       _CTc, _CTc, _CTc, _CTc,                /* 0x00..0x03 */
  444.       _CTc, _CTc, _CTc, _CTc,                /* 0x04..0x07 */
  445. ***************
  446. *** 63,68 ****
  447. --- 63,70 ----
  448.       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0..0xEF */
  449.       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0  /* 0xF0..0xFF */
  450.       };
  451. + unsigned char *_ctype = &(_myctype[0]);
  452.   
  453.   int toupper(c)
  454.       int c;
  455. *** 1.9    1992/02/04 17:11:06
  456. --- doprnt.c    1992/03/06 19:26:15
  457. ***************
  458. *** 22,27 ****
  459. --- 22,28 ----
  460.    *      mjr++
  461.    */
  462.   
  463. + #ifndef __NO_FLOAT__
  464.   static unsigned long
  465.       __notanumber[2] = { 0x7fffffffL, 0xffffffffL }; /* ieee NAN */
  466.   #define NAN  (*((double *)&__notanumber[0]))
  467. ***************
  468. *** 28,33 ****
  469. --- 29,35 ----
  470.   static unsigned long
  471.       __p_infinity[2] = { 0x7ff00000L, 0x00000000L }; /* ieee NAN */
  472.   #define INF  (*((double *)&__p_infinity[0]))
  473. + #endif
  474.   
  475.   #ifdef LIBC_SCCS
  476.   static char sccsid[] = "@(#)doprnt.c    5.37 (Berkeley) 3/26/89";
  477. ***************
  478. *** 168,173 ****
  479. --- 170,176 ----
  480.       char *digs;        /* digits for [diouxX] conversion */
  481.       char buf[BUF];        /* space for %c, %[diouxX], %[eEfgG] */
  482.   
  483. +         t = buf;
  484.       fmt = (const u_char *) fmt0;
  485.       digs = "0123456789abcdef";
  486.       for (cnt = 0;; ++fmt) {
  487. ***************
  488. *** 277,282 ****
  489. --- 280,286 ----
  490.   #define    _double _dd.d
  491.               _double = va_arg(argp, double);
  492.               if( (unsigned long)_dd.i[0] == __notanumber[0])    {
  493. +                 t = buf;
  494.                   t = strcpy(t, " Not A Number ");
  495.                   size = strlen(t);
  496.                   goto pforw;
  497. ***************
  498. *** 308,319 ****
  499.   /*              && ((unsigned long)_dd.i[1] == __p_infinity[1]) */
  500.   /* mjr: don't test this in order to catch a conversion bug in gcc-as     */
  501.               )    {
  502. !             if(softsign == 0)
  503.                   t = strcpy(t, " Infinity ");
  504. !             else
  505.                   t = strcpy(t, " -Infinity ");
  506. !                 size = strlen(t);
  507. !                 goto pforw;
  508.               }
  509.               /*
  510.                * cvt may have to round up past the "start" of the
  511. --- 312,324 ----
  512.   /*              && ((unsigned long)_dd.i[1] == __p_infinity[1]) */
  513.   /* mjr: don't test this in order to catch a conversion bug in gcc-as     */
  514.               )    {
  515. !                 t = buf;
  516. !                 if(softsign == 0)
  517.                   t = strcpy(t, " Infinity ");
  518. !                 else
  519.                   t = strcpy(t, " -Infinity ");
  520. !                 size = strlen(t);
  521. !                 goto pforw;
  522.               }
  523.               /*
  524.                * cvt may have to round up past the "start" of the
  525. *** 1.9    1992/01/29 20:58:29
  526. --- fdopen.c    1992/03/06 19:26:16
  527. ***************
  528. *** 12,18 ****
  529.       extern int __default_mode__;    /* see binmode.c */
  530.       register int i, iomode = 0, f = __default_mode__;
  531.       register FILE *fp = NULL;
  532. !     void _getbuf(FILE *);
  533.   
  534.       for(i=0; (!fp && (i < _NFILE)); ++i)
  535.           if(!(_iob[i]._flag & (_IORW | _IOREAD | _IOWRT)))
  536. --- 12,18 ----
  537.       extern int __default_mode__;    /* see binmode.c */
  538.       register int i, iomode = 0, f = __default_mode__;
  539.       register FILE *fp = NULL;
  540. !     void _getbuf __PROTO((FILE *));
  541.   
  542.       for(i=0; (!fp && (i < _NFILE)); ++i)
  543.           if(!(_iob[i]._flag & (_IORW | _IOREAD | _IOWRT)))
  544. *** 1.5    1991/04/23 16:04:12
  545. --- ftw.c    1992/03/06 19:26:22
  546. ***************
  547. *** 58,64 ****
  548.   
  549.       /* Get ready to hold the full paths. */
  550.       i = strlen(directory);
  551. !     fullpath = malloc(i + 1 + MAXNAMLEN + 1);
  552.       if (fullpath == NULL) {
  553.       closedir(dirp);
  554.       return -1;
  555. --- 58,64 ----
  556.   
  557.       /* Get ready to hold the full paths. */
  558.       i = strlen(directory);
  559. !     fullpath = malloc((size_t)(i + 1 + MAXNAMLEN + 1));
  560.       if (fullpath == NULL) {
  561.       closedir(dirp);
  562.       return -1;
  563. *** 1.4    1991/04/12 18:19:53
  564. --- getbuf.c    1992/03/06 19:26:22
  565. ***************
  566. *** 18,24 ****
  567.           fp->_bsiz = __DEFAULT_BUFSIZ__;
  568.   
  569.       if((f & _IONBF) /* risky!! but works ok with gnu.may change */
  570. !     || ((fp->_base = malloc((size_t)fp->_bsiz)) == NULL) )
  571.           {
  572.           fp->_flag &= ~(_IOFBF | _IOLBF | _IONBF);
  573.           fp->_flag |= _IONBF;
  574. --- 18,24 ----
  575.           fp->_bsiz = __DEFAULT_BUFSIZ__;
  576.   
  577.       if((f & _IONBF) /* risky!! but works ok with gnu.may change */
  578. !         || (!(fp->_base = (unsigned char *)malloc((size_t)fp->_bsiz))) )
  579.           {
  580.           fp->_flag &= ~(_IOFBF | _IOLBF | _IONBF);
  581.           fp->_flag |= _IONBF;
  582. *** 1.9    1991/05/23 14:43:17
  583. --- getcwd.c    1992/03/06 19:26:23
  584. ***************
  585. *** 23,29 ****
  586.   #endif
  587.   
  588.       if (!buf)
  589. !         if (!(buf = malloc((size_t)size)))
  590.               return NULL;
  591.       path[2] = '\0';
  592.       (void)Dgetpath(path+2, 0);
  593. --- 23,29 ----
  594.   #endif
  595.   
  596.       if (!buf)
  597. !         if (!(buf = (char *) malloc((size_t)size)))
  598.               return NULL;
  599.       path[2] = '\0';
  600.       (void)Dgetpath(path+2, 0);
  601. *** 1.6    1991/04/26 03:42:08
  602. --- getenv.c    1992/03/06 19:26:23
  603. ***************
  604. *** 70,79 ****
  605.       del_env(strng);
  606.   
  607.       if (!environ)
  608. !         e = malloc(2*sizeof(char *));
  609.       else {
  610.           while(environ[i]) i++ ;
  611. !         e = malloc((i+2)*sizeof(char *));
  612.           if (!e) {
  613.               return -1;
  614.           }
  615. --- 70,79 ----
  616.       del_env(strng);
  617.   
  618.       if (!environ)
  619. !         e = (char **) malloc(2*sizeof(char *));
  620.       else {
  621.           while(environ[i]) i++ ;
  622. !         e = (char **) malloc((i+2)*sizeof(char *));
  623.           if (!e) {
  624.               return -1;
  625.           }
  626. *** 1.6    1991/04/26 03:42:08
  627. --- getopt.c    1992/03/06 19:26:23
  628. ***************
  629. *** 20,25 ****
  630. --- 20,27 ----
  631.   int    optind = 1;            /* next argv[] index */
  632.   char    *optarg = NULL;            /* option parameter if any */
  633.   
  634. + static char mtail[] = " -- x\n";
  635.   static int
  636.   Err( name, mess, c )            /* returns '?' */
  637.       char    *name;            /* program name argv[0] */
  638. ***************
  639. *** 27,37 ****
  640.       int    c;            /* defective option letter */
  641.       {
  642.       if ( opterr )
  643. !         (void) fprintf( stderr,
  644. !                 "%s: %s -- %c\n",
  645. !                 name, mess, c
  646. !                   );
  647.       return '?';            /* erroneous-option marker */
  648.       }
  649.   
  650. --- 29,41 ----
  651.       int    c;            /* defective option letter */
  652.       {
  653.       if ( opterr )
  654. !         {
  655. !             mtail[4] = (char)c;
  656. !             (void) fputs(name, stderr);
  657. !             (void) fputs(": ", stderr);
  658. !             (void) fputs(mess, stderr);
  659. !             (void) fputs(&mtail[0], stderr);
  660. !         }
  661.       return '?';            /* erroneous-option marker */
  662.       }
  663.   
  664. *** 1.7    1991/04/26 03:42:08
  665. --- gnulib2.c    1992/03/06 19:26:26
  666. ***************
  667. *** 29,34 ****
  668. --- 29,54 ----
  669.   #define L_fixdfdi
  670.   #define L_floatdidf
  671.   
  672. + /* gcc-2.0 stuff */
  673. + #define L_lshrsi3
  674. + #define L_lshlsi3
  675. + #define L_ashrsi3
  676. + #define L_ashlsi3
  677. + #define L_eqdf2
  678. + #define L_nedf2
  679. + #define L_gtdf2
  680. + #define L_gedf2
  681. + #define L_ltdf2
  682. + #define L_ledf2
  683. + #define L_fixsfsi
  684. + #define L_floatsisf
  685. + #define L_eqsf2
  686. + #define L_nesf2
  687. + #define L_gtsf2
  688. + #define L_gesf2
  689. + #define L_ltsf2
  690. + #define L_lesf2
  691.   #endif /* __DEF_ALL__ */
  692.   
  693.   /* More subroutines needed by GCC output code on some machines.  */
  694. ***************
  695. *** 1033,1036 ****
  696. --- 1053,1625 ----
  697.   }
  698.   #endif /* not mips */
  699.   #endif /* not sparc */
  700. + #endif
  701. + /* stuff for gcc-2.0, note that you cannot compile the corresponding
  702. +    C code from libgcc1.c for these functions with gcc-2.0!
  703. +    This stuff should eventually be hand optimized as we have done
  704. +    with the other stuff,
  705. +  */
  706. + #if 0    /* these were the decls used to compile the asm below */
  707. + #ifndef SItype
  708. + #define SItype long int
  709. + #endif
  710. + #ifndef FLOAT_VALUE_TYPE  
  711. + #define FLOAT_VALUE_TYPE long int
  712. + #endif
  713. + #ifndef INTIFY
  714. + #define INTIFY(FLOATVAL)  (intify.f = (FLOATVAL), intify.i)
  715. + #endif
  716. + #ifndef FLOATIFY
  717. + #define FLOATIFY(INTVAL)  ((INTVAL).f)
  718. + #endif
  719. + #ifndef FLOAT_ARG_TYPE
  720. + #define FLOAT_ARG_TYPE union flt_or_int
  721. + #endif
  722. + union flt_or_value { FLOAT_VALUE_TYPE i; float f; };
  723. + union flt_or_int { long int i; float f; };
  724. + #endif
  725. + #ifdef L_lshrsi3
  726. + #if 0
  727. + SItype
  728. + __lshrsi3 (a, b)
  729. +      unsigned SItype a, b;
  730. + {
  731. +   return a >> b;
  732. + }
  733. + #endif
  734. + asm("    .text
  735. +     .even
  736. + .globl ___lshrsi3
  737. + ___lshrsi3:
  738. +     movel sp@(4),d0
  739. +     movel sp@(8),d1
  740. +     lsrl d1,d0
  741. +     rts
  742. + ");
  743. + #endif
  744. + #ifdef L_lshlsi3
  745. + #if 0
  746. + SItype
  747. + __lshlsi3 (a, b)
  748. +      unsigned SItype a, b;
  749. + {
  750. +   return a << b;
  751. + }
  752. + #endif
  753. + asm("   .text
  754. +     .even
  755. + .globl ___lshlsi3
  756. + ___lshlsi3:
  757. +     movel sp@(4),d0
  758. +     movel sp@(8),d1
  759. +     lsll d1,d0
  760. +     rts
  761. + ");
  762. + #endif
  763. + #ifdef L_ashrsi3
  764. + #if 0
  765. + SItype
  766. + __ashrsi3 (a, b)
  767. +      SItype a, b;
  768. + {
  769. +   return a >> b;
  770. + }
  771. + #endif
  772. + asm("   .text
  773. +     .even
  774. + .globl ___ashrsi3
  775. + ___ashrsi3:
  776. +     movel sp@(4),d0
  777. +     movel sp@(8),d1
  778. +     asrl d1,d0
  779. +     rts
  780. + ");
  781. + #endif
  782. + #ifdef L_ashlsi3
  783. + #if 0
  784. + SItype
  785. + __ashlsi3 (a, b)
  786. +      SItype a, b;
  787. + {
  788. +   return a << b;
  789. + }
  790. + #endif
  791. + asm("    .text
  792. +     .even
  793. + .globl ___ashlsi3
  794. + ___ashlsi3:
  795. +     movel sp@(4),d0
  796. +     movel sp@(8),d1
  797. +     asll d1,d0
  798. +     rts
  799. + ");
  800. + #endif
  801. + #ifdef L_eqdf2
  802. + #if 0
  803. + SItype
  804. + __eqdf2 (a, b)
  805. +      double a, b;
  806. + {
  807. +   /* Value == 0 iff a == b.  */
  808. +   return !(a == b);
  809. + }
  810. + #endif
  811. + asm("    .text
  812. +     .even
  813. + .globl ___eqdf2
  814. + ___eqdf2:
  815. +     moveml #0x3000,sp@-
  816. +     movel sp@(12),d1
  817. +     movel sp@(16),d2
  818. +     movel sp@(24),sp@-
  819. +     movel sp@(24),sp@-
  820. +     movel d2,sp@-
  821. +     movel d1,sp@-
  822. +     jbsr ___cmpdf2
  823. +     addw #16,sp
  824. +     tstl d0
  825. +     sne d0
  826. +     moveq #1,d3
  827. +     andl d3,d0
  828. +     moveml sp@+,#0xc
  829. +     rts
  830. + ");
  831. + #endif
  832. + #ifdef L_nedf2
  833. + #if 0
  834. + SItype
  835. + __nedf2 (a, b)
  836. +      double a, b;
  837. + {
  838. +   /* Value != 0 iff a != b.  */
  839. +   return a != b;
  840. + }
  841. + #endif
  842. + asm("    .text
  843. +     .even
  844. + .globl ___nedf2
  845. + ___nedf2:
  846. +     moveml #0x3000,sp@-
  847. +     movel sp@(12),d1
  848. +     movel sp@(16),d2
  849. +     movel sp@(24),sp@-
  850. +     movel sp@(24),sp@-
  851. +     movel d2,sp@-
  852. +     movel d1,sp@-
  853. +     jbsr ___cmpdf2
  854. +     addw #16,sp
  855. +     tstl d0
  856. +     sne d0
  857. +     moveq #1,d3
  858. +     andl d3,d0
  859. +     moveml sp@+,#0xc
  860. +     rts
  861. + ");
  862. + #endif
  863. + #ifdef L_gtdf2
  864. + #if 0
  865. + SItype
  866. + __gtdf2 (a, b)
  867. +      double a, b;
  868. + {
  869. +   /* Value > 0 iff a > b.  */
  870. +   return a > b;
  871. + }
  872. + #endif
  873. + asm("    .text
  874. +     .even
  875. + .globl ___gtdf2
  876. + ___gtdf2:
  877. +     moveml #0x3000,sp@-
  878. +     movel sp@(12),d1
  879. +     movel sp@(16),d2
  880. +     movel sp@(24),sp@-
  881. +     movel sp@(24),sp@-
  882. +     movel d2,sp@-
  883. +     movel d1,sp@-
  884. +     jbsr ___cmpdf2
  885. +     addw #16,sp
  886. +     tstl d0
  887. +     sgt d0
  888. +     moveq #1,d3
  889. +     andl d3,d0
  890. +     moveml sp@+,#0xc
  891. +     rts
  892. + ");
  893. + #endif
  894. + #ifdef L_gedf2
  895. + #if 0
  896. + SItype
  897. + __gedf2 (a, b)
  898. +      double a, b;
  899. + {
  900. +   /* Value >= 0 iff a >= b.  */
  901. +   return (a >= b) - 1;
  902. + }
  903. + #endif
  904. + asm("    .text
  905. +     .even
  906. + .globl ___gedf2
  907. + ___gedf2:
  908. +     moveml #0x3000,sp@-
  909. +     movel sp@(12),d1
  910. +     movel sp@(16),d2
  911. +     movel sp@(24),sp@-
  912. +     movel sp@(24),sp@-
  913. +     movel d2,sp@-
  914. +     movel d1,sp@-
  915. +     jbsr ___cmpdf2
  916. +     addw #16,sp
  917. +     tstl d0
  918. +     sge d0
  919. +     moveq #1,d3
  920. +     andl d3,d0
  921. +     subql #1,d0
  922. +     moveml sp@+,#0xc
  923. +     rts
  924. + ");
  925. + #endif
  926. + #ifdef L_ltdf2
  927. + #if 0
  928. + SItype
  929. + __ltdf2 (a, b)
  930. +      double a, b;
  931. + {
  932. +   /* Value < 0 iff a < b.  */
  933. +   return -(a < b);
  934. + }
  935. + #endif
  936. + asm("    .text
  937. +     .even
  938. + .globl ___ltdf2
  939. + ___ltdf2:
  940. +     moveml #0x3000,sp@-
  941. +     movel sp@(12),d1
  942. +     movel sp@(16),d2
  943. +     movel sp@(24),sp@-
  944. +     movel sp@(24),sp@-
  945. +     movel d2,sp@-
  946. +     movel d1,sp@-
  947. +     jbsr ___cmpdf2
  948. +     addw #16,sp
  949. +     tstl d0
  950. +     slt d0
  951. +     moveq #1,d3
  952. +     andl d3,d0
  953. +     negl d0
  954. +     moveml sp@+,#0xc
  955. +     rts
  956. + ");
  957. + #endif
  958. + #ifdef L_ledf2
  959. + #if 0
  960. + SItype
  961. + __ledf2 (a, b)
  962. +      double a, b;
  963. + {
  964. +   /* Value <= 0 iff a <= b.  */
  965. +   return 1 - (a <= b);
  966. + }
  967. + #endif
  968. + asm("    .text
  969. +     .even
  970. + .globl ___ledf2
  971. + ___ledf2:
  972. +     movel d2,sp@-
  973. +     movel sp@(8),d0
  974. +     movel sp@(12),d1
  975. +     moveq #1,d2
  976. +     movel sp@(20),sp@-
  977. +     movel sp@(20),sp@-
  978. +     movel d1,sp@-
  979. +     movel d0,sp@-
  980. +     jbsr ___cmpdf2
  981. +     addw #16,sp
  982. +     tstl d0
  983. +     jgt L11
  984. +     moveq #0,d2
  985. + L11:
  986. +     movel d2,d0
  987. +     movel sp@+,d2
  988. +     rts
  989. + ");
  990. + #endif
  991. + #ifdef L_fixsfsi
  992. + #if 0
  993. + SItype
  994. + __fixsfsi (a)
  995. +      FLOAT_ARG_TYPE a;
  996. + {
  997. +   union flt_or_value intify;
  998. + #define perform_fixsfsi(a) return (SItype) a
  999. +   perform_fixsfsi (FLOATIFY (a));
  1000. + }
  1001. + #endif
  1002. + asm("    .text
  1003. +     .even
  1004. + .globl ___fixsfsi
  1005. + ___fixsfsi:
  1006. +     movel sp@(4),sp@-
  1007. +     jbsr ___extendsfdf2
  1008. +     addqw #4,sp
  1009. +     movel d1,sp@-
  1010. +     movel d0,sp@-
  1011. +     jbsr ___fixdfsi
  1012. +     addqw #8,sp
  1013. +     rts
  1014. + ");
  1015. + #endif
  1016. + #ifdef L_floatsisf
  1017. + #if 0
  1018. + FLOAT_VALUE_TYPE
  1019. + __floatsisf (a)
  1020. +      SItype a;
  1021. + {
  1022. +   union flt_or_value intify;
  1023. + #define perform_floatsisf(a)  return INTIFY ((float) a)
  1024. +   perform_floatsisf (a);
  1025. + }
  1026. + #endif
  1027. + asm("    .text
  1028. +     .even
  1029. + .globl ___floatsisf
  1030. + ___floatsisf:
  1031. +     movel sp@(4),sp@-
  1032. +     jbsr ___floatsidf
  1033. +     addqw #4,sp
  1034. +     movel d1,sp@-
  1035. +     movel d0,sp@-
  1036. +     jbsr ___truncdfsf2
  1037. +     addqw #8,sp
  1038. +     rts
  1039. + ");
  1040. + #endif
  1041. + #ifdef L_eqsf2
  1042. + #if 0
  1043. + SItype
  1044. + __eqsf2 (a, b)
  1045. +      FLOAT_ARG_TYPE a, b;
  1046. + {
  1047. +   union flt_or_int intify;
  1048. +   /* Value == 0 iff a == b.  */
  1049. + #define perform_eqsf2(a, b) return !(a == b)
  1050. +   perform_eqsf2 (FLOATIFY (a), FLOATIFY (b));
  1051. + }
  1052. + #endif
  1053. + asm("    .text
  1054. +     .even
  1055. + .globl ___eqsf2
  1056. + ___eqsf2:
  1057. +     movel d2,sp@-
  1058. +     movel sp@(8),d1
  1059. +     movel sp@(12),sp@-
  1060. +     movel d1,sp@-
  1061. +     jbsr ___cmpsf2
  1062. +     addqw #8,sp
  1063. +     tstl d0
  1064. +     sne d0
  1065. +     moveq #1,d2
  1066. +     andl d2,d0
  1067. +     movel sp@+,d2
  1068. +     rts
  1069. + ");
  1070. + #endif
  1071. + #ifdef L_nesf2
  1072. + #if 0
  1073. + SItype
  1074. + __nesf2 (a, b)
  1075. +      FLOAT_ARG_TYPE a, b;
  1076. + {
  1077. +   union flt_or_int intify;
  1078. +   /* Value != 0 iff a != b.  */
  1079. + #define perform_nesf2(a, b) return a != b
  1080. +   perform_nesf2 (FLOATIFY (a), FLOATIFY (b));
  1081. + }
  1082. + #endif
  1083. + asm("    .text
  1084. +     .even
  1085. + .globl ___nesf2
  1086. + ___nesf2:
  1087. +     movel d2,sp@-
  1088. +     movel sp@(8),d1
  1089. +     movel sp@(12),sp@-
  1090. +     movel d1,sp@-
  1091. +     jbsr ___cmpsf2
  1092. +     addqw #8,sp
  1093. +     tstl d0
  1094. +     sne d0
  1095. +     moveq #1,d2
  1096. +     andl d2,d0
  1097. +     movel sp@+,d2
  1098. +     rts
  1099. + ");
  1100. + #endif
  1101. + #ifdef L_gtsf2
  1102. + #if 0
  1103. + SItype
  1104. + __gtsf2 (a, b)
  1105. +      FLOAT_ARG_TYPE a, b;
  1106. + {
  1107. +   union flt_or_int intify;
  1108. +   /* Value > 0 iff a > b.  */
  1109. + #define perform_gtsf2(a, b) return a > b
  1110. +   perform_gtsf2 (FLOATIFY (a), FLOATIFY (b));
  1111. + }
  1112. + #endif
  1113. + asm("    .text
  1114. +     .even
  1115. + .globl ___gtsf2
  1116. + ___gtsf2:
  1117. +     movel d2,sp@-
  1118. +     movel sp@(8),d1
  1119. +     movel sp@(12),sp@-
  1120. +     movel d1,sp@-
  1121. +     jbsr ___cmpsf2
  1122. +     addqw #8,sp
  1123. +     tstl d0
  1124. +     sgt d0
  1125. +     moveq #1,d2
  1126. +     andl d2,d0
  1127. +     movel sp@+,d2
  1128. +     rts
  1129. + ");
  1130. + #endif
  1131. + #ifdef L_gesf2
  1132. + #if 0
  1133. + SItype
  1134. + __gesf2 (a, b)
  1135. +      FLOAT_ARG_TYPE a, b;
  1136. + {
  1137. +   union flt_or_int intify;
  1138. +   /* Value >= 0 iff a >= b.  */
  1139. + #define perform_gesf2(a, b) return (a >= b) - 1
  1140. +   perform_gesf2 (FLOATIFY (a), FLOATIFY (b));
  1141. + }
  1142. + #endif
  1143. + asm("    .text
  1144. +     .even
  1145. + .globl ___gesf2
  1146. + ___gesf2:
  1147. +     movel d2,sp@-
  1148. +     movel sp@(8),d1
  1149. +     movel sp@(12),sp@-
  1150. +     movel d1,sp@-
  1151. +     jbsr ___cmpsf2
  1152. +     addqw #8,sp
  1153. +     tstl d0
  1154. +     sge d0
  1155. +     moveq #1,d2
  1156. +     andl d2,d0
  1157. +     subql #1,d0
  1158. +     movel sp@+,d2
  1159. +     rts
  1160. + ");
  1161. + #endif
  1162. + #ifdef L_ltsf2
  1163. + #if 0
  1164. + SItype
  1165. + __ltsf2 (a, b)
  1166. +      FLOAT_ARG_TYPE a, b;
  1167. + {
  1168. +   union flt_or_int intify;
  1169. +   /* Value < 0 iff a < b.  */
  1170. + #define perform_ltsf2(a, b) return -(a < b)
  1171. +   perform_ltsf2 (FLOATIFY (a), FLOATIFY (b));
  1172. + }
  1173. + #endif
  1174. + asm("    .text
  1175. +     .even
  1176. + .globl ___ltsf2
  1177. + ___ltsf2:
  1178. +     movel d2,sp@-
  1179. +     movel sp@(8),d1
  1180. +     movel sp@(12),sp@-
  1181. +     movel d1,sp@-
  1182. +     jbsr ___cmpsf2
  1183. +     addqw #8,sp
  1184. +     tstl d0
  1185. +     slt d0
  1186. +     moveq #1,d2
  1187. +     andl d2,d0
  1188. +     negl d0
  1189. +     movel sp@+,d2
  1190. +     rts
  1191. + ");
  1192. + #endif
  1193. + #ifdef L_lesf2
  1194. + #if 0
  1195. + SItype
  1196. + __lesf2 (a, b)
  1197. +      FLOAT_ARG_TYPE a, b;
  1198. + {
  1199. +   union flt_or_int intify;
  1200. +   /* Value <= 0 iff a <= b.  */
  1201. + #define perform_lesf2(a, b) return 1 - (a <= b); /* note bug fix from libgcc1.c */
  1202. +   perform_lesf2 (FLOATIFY (a), FLOATIFY (b));
  1203. + }
  1204. + #endif
  1205. + asm("    .text
  1206. +     .even
  1207. + .globl ___lesf2
  1208. + ___lesf2:
  1209. +     movel d2,sp@-
  1210. +     movel sp@(8),d0
  1211. +     moveq #1,d2
  1212. +     movel sp@(12),sp@-
  1213. +     movel d0,sp@-
  1214. +     jbsr ___cmpsf2
  1215. +     addqw #8,sp
  1216. +     tstl d0
  1217. +     jgt L20
  1218. +     moveq #0,d2
  1219. + L20:
  1220. +     movel d2,d0
  1221. +     movel sp@+,d2
  1222. +     rts
  1223. + ");
  1224.   #endif
  1225. *** 1.4    1992/02/04 17:11:06
  1226. --- ldexp.cpp    1992/03/06 19:26:28
  1227. ***************
  1228. *** 208,231 ****
  1229.   #endif    ERROR_CHECK
  1230.   
  1231.   _ldexp:
  1232. !     lea    0xfffa50,a0        | fpu address
  1233. !     movew    #0x4011,a0@(comm)    | ftwotox to fp0 (as long int!)
  1234.   #ifdef __MSHORT__
  1235. !     movew    a7@(12),d0        | get exponent
  1236.       extl    d0
  1237.   #else
  1238. !     movel    a7@(12),d0        | get exponent
  1239.   #endif
  1240. !     cmpiw    #0x8900,a0@(resp)    | check if fpu is ready
  1241. !     movel    d0,a0@            | push arg
  1242. !     .long    0x0c6889000, 0xfff067f8    | wait
  1243. !     movew    #0x5423,a0@(comm)    | fmul value,fp0
  1244. !     .long    0x0c6889000, 0xfff067f8    | wait
  1245. !     movel    a7@(4),a0@        | load value
  1246. !     movel    a7@(8),a0@        |
  1247. !     .long    0x0c6889000, 0xfff067f8    | wait
  1248. !     movew    #0x7400,a0@(comm)    | get double from fp0
  1249. !     .long    0x0c6889000, 0xfff067f8    | wait
  1250.       movel    a0@,d0
  1251.       movel    a0@,d1
  1252.   #endif    sfp004
  1253. --- 208,238 ----
  1254.   #endif    ERROR_CHECK
  1255.   
  1256.   _ldexp:
  1257.   #ifdef __MSHORT__
  1258. !     movew    sp@(12),d0        | get exponent
  1259.       extl    d0
  1260.   #else
  1261. !     movel    sp@(12),d0        | get exponent
  1262.   #endif
  1263. !     lea    0xfffa50,a0        | fpu address
  1264. !     movew    #0x549e,a0@(comm)    | fgetexpd sp@(4),fp1
  1265. !     cmpiw    #0x8900,a0@(resp)
  1266. !     movel    sp@(4),a0@
  1267. !     movel    sp@(8),a0@
  1268. !     movew    #0x6080,a0@(comm)    | fmovel fp1,d1
  1269. !     .long    0x0c688900, 0xfff067f8
  1270. !     movel    a0@,d1
  1271. !     addl    d0,d1
  1272. !     movew    #0x4011,a0@(comm)    | ftwotoxl d0,fp0
  1273. !     .long    0x0c688900, 0xfff067f8
  1274. !     movel    d0,a0@
  1275. !     movew    #0x5423,a0@(comm)    | fmuld sp@(4),fp0
  1276. !     .long    0x0c688900, 0xfff067f8
  1277. !     movel    sp@(4),a0@
  1278. !     movel    sp@(8),a0@
  1279. !     movew    #0x7400,a0@(comm)    | fmoved fp0,d0/d1
  1280. !     .long    0x0c688900, 0xfff067f8
  1281.       movel    a0@,d0
  1282.       movel    a0@,d1
  1283.   #endif    sfp004
  1284. *** 1.27    1991/06/26 22:31:51
  1285. --- makefile.16    1992/03/06 19:26:30
  1286. ***************
  1287. *** 9,15 ****
  1288.   LIB = d:\gnu\lib
  1289.   
  1290.   # common subset of options; no int size or omit-frame-pointer:
  1291. ! COPTS= -O -fcombine-regs -fstrength-reduce -DNDEBUG $(XFLAGS)
  1292.   
  1293.   # Base options CC; includes int size but not omit-frame-pointer
  1294.   CFFLAGS = $(COPTS) -mshort
  1295. --- 9,15 ----
  1296.   LIB = d:\gnu\lib
  1297.   
  1298.   # common subset of options; no int size or omit-frame-pointer:
  1299. ! COPTS= -O -fstrength-reduce -DNDEBUG $(XFLAGS)
  1300.   
  1301.   # Base options CC; includes int size but not omit-frame-pointer
  1302.   CFFLAGS = $(COPTS) -mshort
  1303. *** 1.26    1991/06/26 22:31:51
  1304. --- makefile.32    1992/03/06 19:26:30
  1305. ***************
  1306. *** 9,15 ****
  1307.   LIB = d:\gnu\lib
  1308.   
  1309.   # common subset of options; no int size or omit-frame-pointer:
  1310. ! COPTS= -O -fcombine-regs -fstrength-reduce -DNDEBUG $(XFLAGS)
  1311.   
  1312.   # Base options CC; includes int size but not omit-frame-pointer
  1313.   CFFLAGS = $(COPTS)
  1314. --- 9,15 ----
  1315.   LIB = d:\gnu\lib
  1316.   
  1317.   # common subset of options; no int size or omit-frame-pointer:
  1318. ! COPTS= -O -fstrength-reduce -DNDEBUG $(XFLAGS)
  1319.   
  1320.   # Base options CC; includes int size but not omit-frame-pointer
  1321.   CFFLAGS = $(COPTS)
  1322. *** 1.19    1992/01/29 20:58:29
  1323. --- malloc.c    1992/03/06 19:26:31
  1324. ***************
  1325. *** 164,171 ****
  1326.       if ((!_split_mem) && _heapbase != NULL &&
  1327.           s >= (struct mem_chunk *) _heapbase &&
  1328.           s < (struct mem_chunk *) (_heapbase + _stksize)) {
  1329. !       assert(s == _heapbase);
  1330. !       _heapbase = (char *) p;
  1331.         _stksize += p->size;
  1332.         o->next = p->next;    /* o is always != NULL here */
  1333.       }
  1334. --- 164,171 ----
  1335.       if ((!_split_mem) && _heapbase != NULL &&
  1336.           s >= (struct mem_chunk *) _heapbase &&
  1337.           s < (struct mem_chunk *) (_heapbase + _stksize)) {
  1338. !       assert(s == (struct mem_chunk *) _heapbase);
  1339. !       _heapbase = (void *) p;
  1340.         _stksize += p->size;
  1341.         o->next = p->next;    /* o is always != NULL here */
  1342.       }
  1343. ***************
  1344. *** 176,183 ****
  1345.         if ((!_split_mem) && _heapbase != NULL &&
  1346.             s >= (struct mem_chunk *) _heapbase &&
  1347.             s < (struct mem_chunk *) (_heapbase + _stksize)) {
  1348. !         assert(s == _heapbase);
  1349. !         _heapbase = (char *) r;
  1350.           _stksize += r->size;
  1351.           p->next = r->next;
  1352.         } else p->next = r;
  1353. --- 176,183 ----
  1354.         if ((!_split_mem) && _heapbase != NULL &&
  1355.             s >= (struct mem_chunk *) _heapbase &&
  1356.             s < (struct mem_chunk *) (_heapbase + _stksize)) {
  1357. !         assert(s == (struct mem_chunk *) _heapbase);
  1358. !         _heapbase = (void *) r;
  1359.           _stksize += r->size;
  1360.           p->next = r->next;
  1361.         } else p->next = r;
  1362. ***************
  1363. *** 190,196 ****
  1364.   void *_r;
  1365.   size_t n;
  1366.   {
  1367. !   struct mem_chunk *p, *q, *r = _r;
  1368.     long sz;
  1369.   
  1370.   /* obscure features: realloc(NULL,n) is the same as malloc(n)
  1371. --- 190,196 ----
  1372.   void *_r;
  1373.   size_t n;
  1374.   {
  1375. !   struct mem_chunk *p, *q, *r = (struct mem_chunk *) _r;
  1376.     long sz;
  1377.   
  1378.   /* obscure features: realloc(NULL,n) is the same as malloc(n)
  1379. ***************
  1380. *** 256,262 ****
  1381.   void * calloc(n, sz)
  1382.   size_t n, sz;
  1383.   {
  1384. !   char *r;
  1385.     size_t total;
  1386.   
  1387.     total = n * sz;
  1388. --- 256,262 ----
  1389.   void * calloc(n, sz)
  1390.   size_t n, sz;
  1391.   {
  1392. !   void *r;
  1393.     size_t total;
  1394.   
  1395.     total = n * sz;
  1396. *** 1.5    1991/05/23 14:43:17
  1397. --- memccpy.c    1992/03/06 19:26:31
  1398. ***************
  1399. *** 31,38 ****
  1400.       if (size == 0)
  1401.           return(NULL);
  1402.   
  1403. !     s = src;
  1404. !     d = dst;
  1405.       uc = UNSCHAR(ucharstop);
  1406.       for (n = size; n > 0; n--)
  1407.           if (UNSCHAR(*d++ = *s++) == uc)
  1408. --- 31,38 ----
  1409.       if (size == 0)
  1410.           return(NULL);
  1411.   
  1412. !     s = (const char *) src;
  1413. !     d = (char *)dst;
  1414.       uc = UNSCHAR(ucharstop);
  1415.       for (n = size; n > 0; n--)
  1416.           if (UNSCHAR(*d++ = *s++) == uc)
  1417. *** 1.4    1989/11/12 12:47:43
  1418. --- memchr.c    1992/03/06 19:26:31
  1419. ***************
  1420. *** 26,32 ****
  1421.       register size_t n;
  1422.       register int uc;
  1423.   
  1424. !     scan = s;
  1425.       uc = UNSCHAR(ucharwanted);
  1426.       for (n = size; n > 0; n--)
  1427.           if (UNSCHAR(*scan) == uc)
  1428. --- 26,32 ----
  1429.       register size_t n;
  1430.       register int uc;
  1431.   
  1432. !     scan = (const char *) s;
  1433.       uc = UNSCHAR(ucharwanted);
  1434.       for (n = size; n > 0; n--)
  1435.           if (UNSCHAR(*scan) == uc)
  1436. *** 1.3    1989/03/25 02:56:28
  1437. --- memcmp.c    1992/03/06 19:26:32
  1438. ***************
  1439. *** 17,24 ****
  1440.       register const char *scan2;
  1441.       register size_t n;
  1442.   
  1443. !     scan1 = s1;
  1444. !     scan2 = s2;
  1445.       for (n = size; n > 0; n--)
  1446.           if (*scan1 == *scan2) {
  1447.               scan1++;
  1448. --- 17,24 ----
  1449.       register const char *scan2;
  1450.       register size_t n;
  1451.   
  1452. !     scan1 = (const char *) s1;
  1453. !     scan2 = (const char *) s2;
  1454.       for (n = size; n > 0; n--)
  1455.           if (*scan1 == *scan2) {
  1456.               scan1++;
  1457. *** 1.4    1989/03/25 04:18:12
  1458. --- memset.c    1992/03/06 19:26:32
  1459. ***************
  1460. *** 25,31 ****
  1461.       register size_t n;
  1462.       register int uc;
  1463.   
  1464. !     scan = s;
  1465.       uc = UNSCHAR(ucharfill);
  1466.       for (n = size; n > 0; n--)
  1467.           *scan++ = uc;
  1468. --- 25,31 ----
  1469.       register size_t n;
  1470.       register int uc;
  1471.   
  1472. !     scan = (char *)s;
  1473.       uc = UNSCHAR(ucharfill);
  1474.       for (n = size; n > 0; n--)
  1475.           *scan++ = uc;
  1476. *** 1.15    1992/02/04 17:11:06
  1477. --- mincl    1992/03/06 19:26:32
  1478. ***************
  1479. *** 9,15 ****
  1480.   GLIB2 = _adddi3.o _subdi3.o _muldi3.o _divdi3.o _moddi3.o _udivdi3.o \
  1481.           _umoddi3.o _negdi2.o _anddi3.o _iordi3.o _xordi3.o _lshrdi3.o \
  1482.           _lshldi3.o _ashldi3.o _ashrdi3.o _one_cmpldi2.o _bdiv.o _cmpdi2.o \
  1483. !         _ucmpdi2.o _fixunsdfdi.o _fixdfdi.o _floatdidf.o
  1484.   
  1485.   GCC=     $(GLIB1) $(GLIB2) \
  1486.       ldexp.o frexp.o modf.o alloca.o setjmp.o osbind.o\
  1487. --- 9,19 ----
  1488.   GLIB2 = _adddi3.o _subdi3.o _muldi3.o _divdi3.o _moddi3.o _udivdi3.o \
  1489.           _umoddi3.o _negdi2.o _anddi3.o _iordi3.o _xordi3.o _lshrdi3.o \
  1490.           _lshldi3.o _ashldi3.o _ashrdi3.o _one_cmpldi2.o _bdiv.o _cmpdi2.o \
  1491. !         _ucmpdi2.o _fixunsdfdi.o _fixdfdi.o _floatdidf.o \
  1492. !     _lshrsi3.o _lshlsi3.o _ashrsi3.o _ashlsi3.o _eqdf2.o \
  1493. !     _nedf2.o _gtdf2.o _gedf2.o _ltdf2.o _ledf2.o _fixsfsi.o \
  1494. !     _floatsisf.o _eqsf2.o _nesf2.o _gtsf2.o _gesf2.o _ltsf2.o \
  1495. !     _lesf2.o
  1496.   
  1497.   GCC=     $(GLIB1) $(GLIB2) \
  1498.       ldexp.o frexp.o modf.o alloca.o setjmp.o osbind.o\
  1499. ***************
  1500. *** 117,122 ****
  1501. --- 121,127 ----
  1502.   
  1503.   # other dependencies
  1504.   bcopy.o : bcopy.s
  1505. + memcpy.o: memcpy.s
  1506.   atof.o  : flonum.h
  1507.   
  1508.   #
  1509. *** 1.9    1991/12/26 15:53:59
  1510. --- mkdir.c    1992/03/06 19:26:33
  1511. ***************
  1512. *** 1,5 ****
  1513. --- 1,6 ----
  1514.   /* mkdir: make a new directory
  1515.    * written by Eric R. Smith and placed in the public domain
  1516. +  * modified by Alan Hourihane, to check for directory and return EEXIST.
  1517.    */
  1518.   
  1519.   #include <stdio.h>
  1520. ***************
  1521. *** 6,11 ****
  1522. --- 7,15 ----
  1523.   #include <osbind.h>
  1524.   #include <support.h>
  1525.   #include <unistd.h>
  1526. + #include <errno.h>
  1527. + #include <types.h>
  1528. + #include <stat.h>
  1529.   #include "symdir.h"
  1530.   #include "lib.h"
  1531.   
  1532. ***************
  1533. *** 16,21 ****
  1534. --- 20,26 ----
  1535.   int mode;
  1536.   {
  1537.       int rv, name_munged;
  1538. +     struct stat statbuf;
  1539.       char path[FILENAME_MAX];
  1540.   
  1541.   /*
  1542. ***************
  1543. *** 25,30 ****
  1544. --- 30,46 ----
  1545.    * in the global variable __link_name[].
  1546.    */
  1547.       name_munged = (unx2dos(_path, path) == _NM_CHANGE);
  1548. +     rv = stat(path, &statbuf);    /* Stat directory */
  1549. +     if (rv == 0) {            /* Does it exist ? */
  1550. +         errno = EEXIST;        /* Yes, so tell user. */
  1551. +         return -1;
  1552. +     }
  1553. +     if (errno != ENOENT) {        /* Return stat error, if other than */
  1554. +         return -1;        /* File not found. */
  1555. +     }
  1556.       rv = Dcreate(path);
  1557.       if (rv < 0) {
  1558.           errno = -rv;
  1559. *** 1.10    1991/04/26 03:42:08
  1560. --- qsort.c    1992/03/06 19:26:37
  1561. ***************
  1562. *** 35,41 ****
  1563.   #include <compiler.h>
  1564.   #endif
  1565.   
  1566. !     
  1567.       /* the next 4 #defines implement a very fast in-line stack abstraction */
  1568.       
  1569.   #define MAKE_STACK(S) \
  1570. --- 35,44 ----
  1571.   #include <compiler.h>
  1572.   #endif
  1573.   
  1574. ! /* macros for incrementing/decrementing void pointers */
  1575. ! #define INC(v, size) v = (void *)(((char *)v) + size)
  1576. ! #define DEC(v, size) v = (void *)(((char *)v) - size)
  1577.       /* the next 4 #defines implement a very fast in-line stack abstraction */
  1578.       
  1579.   #define MAKE_STACK(S) \
  1580. ***************
  1581. *** 117,124 ****
  1582.          end of the array.  This acts like a sentinel, and it speeds
  1583.          up the inner loop of insertion sort. */
  1584.   
  1585. !     for (run_ptr = (char *)end_ptr - siz; run_ptr >= base;
  1586. !      (char *)run_ptr -= siz)
  1587.       if ((*cmp)(run_ptr, tmp_ptr) > 0) 
  1588.           tmp_ptr = run_ptr;
  1589.   
  1590. --- 120,127 ----
  1591.          end of the array.  This acts like a sentinel, and it speeds
  1592.          up the inner loop of insertion sort. */
  1593.   
  1594. !     for (run_ptr = (void *)((char *)end_ptr - siz); run_ptr >= base;
  1595. !      DEC(run_ptr, siz))
  1596.       if ((*cmp)(run_ptr, tmp_ptr) > 0) 
  1597.           tmp_ptr = run_ptr;
  1598.   
  1599. ***************
  1600. *** 128,143 ****
  1601.       /* Typical insertion sort, but we run from the `right-hand-side'
  1602.          downto the `left-hand-side.' */
  1603.       
  1604. !     for (run_ptr = (char *)end_ptr - siz; run_ptr > base;
  1605. !      (char *)run_ptr -= siz) 
  1606.       {
  1607. !     tmp_ptr = (char *)run_ptr - siz;
  1608.       Move(tmp_ptr, temp, siz);
  1609.   
  1610.       /* Select the correct location for the new element, 
  1611.          by sliding everyone down by 1 to make room! */
  1612.       
  1613.       while ((*cmp)(temp , ((char *)tmp_ptr += siz)) > 0)
  1614.           Move(tmp_ptr, ((unsigned char *)tmp_ptr - siz), siz);
  1615.   
  1616.       Move(temp, (unsigned char *)tmp_ptr - siz, siz);
  1617. --- 131,150 ----
  1618.       /* Typical insertion sort, but we run from the `right-hand-side'
  1619.          downto the `left-hand-side.' */
  1620.       
  1621. !     for (run_ptr = (void *)((char *)end_ptr - siz); run_ptr > base;
  1622. !      DEC(run_ptr, siz))
  1623.       {
  1624. !     tmp_ptr = (void *)((char *)run_ptr - siz);
  1625.       Move(tmp_ptr, temp, siz);
  1626.   
  1627.       /* Select the correct location for the new element, 
  1628.          by sliding everyone down by 1 to make room! */
  1629.       
  1630. + #if 0
  1631.       while ((*cmp)(temp , ((char *)tmp_ptr += siz)) > 0)
  1632. + #else
  1633. +     while (((INC(tmp_ptr, siz)), (*cmp)(temp, tmp_ptr)) > 0)
  1634. + #endif
  1635.           Move(tmp_ptr, ((unsigned char *)tmp_ptr - siz), siz);
  1636.   
  1637.       Move(temp, (unsigned char *)tmp_ptr - siz, siz);
  1638. ***************
  1639. *** 160,166 ****
  1640.       int (*cmp)();
  1641.   #endif
  1642.   {
  1643. !     void *middle = (char *)low + ((((char *)high - (char *)low)/siz) >> 1) * siz;
  1644.       
  1645.       if ((*cmp)(middle, low) < 0)
  1646.       { swap (middle, low, siz); }
  1647. --- 167,173 ----
  1648.       int (*cmp)();
  1649.   #endif
  1650.   {
  1651. !     void *middle = (void *) ((char *)low + ((((char *)high - (char *)low)/siz) >> 1) * siz);
  1652.       
  1653.       if ((*cmp)(middle, low) < 0)
  1654.       { swap (middle, low, siz); }
  1655. ***************
  1656. *** 230,236 ****
  1657.           return;    /* die */
  1658.       
  1659.       lo = base;
  1660. !     hi = (char *)lo + (total_elems - 1) * size;
  1661.   
  1662.       do {
  1663.           next: if((char *)hi <= ((char *)lo + Thresh)) /* correct unsigned comapare */
  1664. --- 237,243 ----
  1665.           return;    /* die */
  1666.       
  1667.       lo = base;
  1668. !     hi = (void *) ((char *)lo + (total_elems - 1) * size);
  1669.   
  1670.       do {
  1671.           next: if((char *)hi <= ((char *)lo + Thresh)) /* correct unsigned comapare */
  1672. ***************
  1673. *** 245,272 ****
  1674.           /* Select the median-of-three here. This allows us to
  1675.              skip forward for the LEFT_PTR and RIGHT_PTR. */
  1676.           pivot = find_pivot (lo, hi, size, cmp);
  1677. !         left_ptr  = (char *)lo + size;
  1678. !         right_ptr = (char *)hi - size; 
  1679.   
  1680.           /* Here's the famous ``collapse the walls'' section of
  1681.              quicksort.  Gotta like those tight inner loops! */
  1682.           do { /* partition loop */  /* see knuth for <= */
  1683.           while ((left_ptr < hi) && ((*cmp)(left_ptr, pivot) <= 0))
  1684. !             (char *)left_ptr += size;
  1685.           
  1686.           while ((right_ptr > lo) && ((*cmp)(pivot, right_ptr) <= 0))
  1687. !             (char *)right_ptr -= size;
  1688.           
  1689.           if (left_ptr < right_ptr) 
  1690.                   {
  1691.               swap (left_ptr, right_ptr, size);
  1692. !             (char *)left_ptr += size;
  1693. !             (char *)right_ptr -= size;
  1694.                   }
  1695.           else if (left_ptr == right_ptr) 
  1696.                   {
  1697. !             (char *)left_ptr +=size; 
  1698. !             (char *)right_ptr -= size; 
  1699.               break;
  1700.                   }
  1701.               } while (left_ptr <= right_ptr);
  1702. --- 252,279 ----
  1703.           /* Select the median-of-three here. This allows us to
  1704.              skip forward for the LEFT_PTR and RIGHT_PTR. */
  1705.           pivot = find_pivot (lo, hi, size, cmp);
  1706. !         left_ptr  = (void *)((char *)lo + size);
  1707. !         right_ptr = (void *)((char *)hi - size); 
  1708.   
  1709.           /* Here's the famous ``collapse the walls'' section of
  1710.              quicksort.  Gotta like those tight inner loops! */
  1711.           do { /* partition loop */  /* see knuth for <= */
  1712.           while ((left_ptr < hi) && ((*cmp)(left_ptr, pivot) <= 0))
  1713. !             INC(left_ptr, size);
  1714.           
  1715.           while ((right_ptr > lo) && ((*cmp)(pivot, right_ptr) <= 0))
  1716. !             DEC(right_ptr, size);
  1717.           
  1718.           if (left_ptr < right_ptr) 
  1719.                   {
  1720.               swap (left_ptr, right_ptr, size);
  1721. !             INC(left_ptr,  size);
  1722. !             DEC(right_ptr, size);
  1723.                   }
  1724.           else if (left_ptr == right_ptr) 
  1725.                   {
  1726. !             INC(left_ptr, size); 
  1727. !             DEC(right_ptr, size); 
  1728.               break;
  1729.                   }
  1730.               } while (left_ptr <= right_ptr);
  1731. *** 1.5    1991/05/23 14:43:17
  1732. --- random.c    1992/03/06 19:26:37
  1733. ***************
  1734. *** 221,226 ****
  1735. --- 221,233 ----
  1736.    * Returns a pointer to the old state.
  1737.    */
  1738.   
  1739. + #if !__STDC__
  1740. +    /* you need an ansi C compatible pre-processor jack! */
  1741. + #else
  1742. + #  define STR(s) # s
  1743. + #  define XSTR(s) STR(s)
  1744. + #endif
  1745.   char  *
  1746.   initstate( seed, arg_state, n )
  1747.   
  1748. ***************
  1749. *** 234,240 ****
  1750. --- 241,251 ----
  1751.       else  state[ -1 ] = MAX_TYPES*(rptr - state) + rand_type;
  1752.       if(  n  <  BREAK_1  )  {
  1753.           if(  n  <  BREAK_0  )  {
  1754. + /*
  1755.           fprintf( stderr, "initstate: not enough state (%d bytes) with which to do jack; ignored.\n", n );
  1756. + */
  1757. +         fputs( "initstate: not enough state (less than " XSTR(BREAK_0)
  1758. +               " bytes)\nwith which to do jack; ignored.\n", stderr);
  1759.           return NULL;
  1760.           }
  1761.           rand_type = TYPE_0;
  1762. ***************
  1763. *** 313,319 ****
  1764. --- 324,335 ----
  1765.           break;
  1766.   
  1767.           default:
  1768. + /**
  1769.           fprintf( stderr, "setstate: state info has been munged; not changed.\n" );
  1770. + **/
  1771. +         fputs("setstate: state info has been munged; not changed.\n",
  1772. +               stderr);
  1773. +         
  1774.       }
  1775.       state = &new_state[ 1 ];
  1776.       if(  rand_type  !=  TYPE_0  )  {
  1777. *** 1.9    1992/02/04 17:11:06
  1778. --- sbrk.c    1992/03/06 19:26:39
  1779. ***************
  1780. *** 32,43 ****
  1781.       sp = (void *)slush;
  1782.       sz = (sz + 7) & ~((size_t)7L); /* round up request size next octet */
  1783.   
  1784. !     if ( sp < (void *)((size_t)_heapbase + sz) )
  1785.       {
  1786.       return NULL;
  1787.       }
  1788.       sp = _heapbase;
  1789. !     _heapbase = (void *)((size_t)_heapbase + sz);
  1790.       _stksize -= (long)sz;
  1791.       
  1792.       return( sp );
  1793. --- 32,43 ----
  1794.       sp = (void *)slush;
  1795.       sz = (sz + 7) & ~((size_t)7L); /* round up request size next octet */
  1796.   
  1797. !     if ( sp < (void *)((char *)_heapbase + sz) )
  1798.       {
  1799.       return NULL;
  1800.       }
  1801.       sp = _heapbase;
  1802. !     _heapbase = (void *)((char *)_heapbase + sz);
  1803.       _stksize -= (long)sz;
  1804.       
  1805.       return( sp );
  1806. *** 1.5    1991/04/12 18:19:53
  1807. --- sleep.c    1992/03/06 19:26:42
  1808. ***************
  1809. *** 27,33 ****
  1810.    *
  1811.    */
  1812.   void
  1813. ! usleep(unsigned long usec)
  1814.   {
  1815.       unsigned long    stop;
  1816.   
  1817. --- 27,34 ----
  1818.    *
  1819.    */
  1820.   void
  1821. ! usleep(usec)
  1822. ! unsigned long usec;
  1823.   {
  1824.       unsigned long    stop;
  1825.   
  1826. *** 1.6    1991/06/11 14:56:53
  1827. --- sprintf.c    1992/03/06 19:26:43
  1828. ***************
  1829. *** 2,7 ****
  1830. --- 2,13 ----
  1831.   #include <stdio.h>
  1832.   #include <limits.h>
  1833.   
  1834. + #ifdef __SOZOBON__    /* Electronic brain... */
  1835. + static FILE dummyf =
  1836. +     {0L, (unsigned char *)0, (unsigned char *)0,
  1837. +          _IOWRT|_IOBIN|_IOSTRING|_IOFBF, 0, LONG_MAX, '\0'};
  1838. + #endif
  1839.   __EXTERN int _doprnt __PROTO((FILE *file, const char *fmt, va_list argp));
  1840.   
  1841.   #ifdef __STDC__
  1842. ***************
  1843. *** 13,22 ****
  1844.   #endif
  1845.       {
  1846.       register int n;
  1847.       FILE sf = 
  1848.       {0L, (unsigned char *)buf, (unsigned char *)buf,
  1849.            _IOWRT|_IOBIN|_IOSTRING|_IOFBF, 0, LONG_MAX,'\0'};
  1850. !     va_list argp;
  1851.       
  1852.       va_start(argp, fmt);
  1853.       n = _doprnt(&sf, fmt, argp);
  1854. --- 19,35 ----
  1855.   #endif
  1856.       {
  1857.       register int n;
  1858. +     va_list argp;
  1859. + #ifndef __SOZOBON__
  1860.       FILE sf = 
  1861.       {0L, (unsigned char *)buf, (unsigned char *)buf,
  1862.            _IOWRT|_IOBIN|_IOSTRING|_IOFBF, 0, LONG_MAX,'\0'};
  1863. ! #else
  1864. !     FILE sf;
  1865. !  
  1866. !     sf = dummyf;
  1867. !     sf._ptr = sf._base = (unsigned char *)buf;
  1868. ! #endif
  1869.       
  1870.       va_start(argp, fmt);
  1871.       n = _doprnt(&sf, fmt, argp);
  1872. ***************
  1873. *** 30,39 ****
  1874. --- 43,58 ----
  1875.       va_list args;
  1876.       {
  1877.       register int n;
  1878. + #ifndef __SOZOBON__    /* Same again, please, landlord. */
  1879.       FILE sf = 
  1880.       {0L, (unsigned char *)buf, (unsigned char *)buf,
  1881.            _IOWRT|_IOBIN|_IOSTRING|_IOFBF, 0, LONG_MAX,'\0'};
  1882. + #else
  1883. +     FILE sf;
  1884.   
  1885. +     sf = dummyf;
  1886. +     sf._ptr = sf._base = (unsigned char *)buf;
  1887. + #endif
  1888.       n = _doprnt(&sf, fmt, args);
  1889.       *(sf._ptr) = '\0';        /* always tie of the string */
  1890.       return(n);
  1891. *** 1.2    1990/04/04 03:11:11
  1892. --- strdup.c    1992/03/06 19:26:46
  1893. ***************
  1894. *** 13,19 ****
  1895.   {
  1896.       char *dup;
  1897.   
  1898. !     dup = malloc(strlen(s)+1);
  1899.       if (dup)
  1900.           strcpy(dup, s);
  1901.       return dup;
  1902. --- 13,19 ----
  1903.   {
  1904.       char *dup;
  1905.   
  1906. !     dup = (char *) malloc(strlen(s)+1);
  1907.       if (dup)
  1908.           strcpy(dup, s);
  1909.       return dup;
  1910. *** 1.13    1992/01/29 20:58:29
  1911. --- system.c    1992/03/06 19:26:51
  1912. ***************
  1913. *** 178,184 ****
  1914.           infd = Fopen(path, 0);
  1915.           if (infd < __SMALLEST_VALID_HANDLE) {
  1916.               perror(infile);
  1917. !             _exit(2);
  1918.           }
  1919.           oldin = Fdup(0);
  1920.           (void)Fforce(0, infd);
  1921. --- 178,184 ----
  1922.           infd = Fopen(path, 0);
  1923.           if (infd < __SMALLEST_VALID_HANDLE) {
  1924.               perror(infile);
  1925. !             return(2);
  1926.           }
  1927.           oldin = Fdup(0);
  1928.           (void)Fforce(0, infd);
  1929. ***************
  1930. *** 196,202 ****
  1931.               outfd = Fcreate(path, 0);
  1932.           if (outfd < __SMALLEST_VALID_HANDLE) {
  1933.               perror(outfile);
  1934. !             _exit(2);
  1935.           }
  1936.           oldout = Fdup(1);
  1937.           (void)Fforce(1, outfd);
  1938. --- 196,202 ----
  1939.               outfd = Fcreate(path, 0);
  1940.           if (outfd < __SMALLEST_VALID_HANDLE) {
  1941.               perror(outfile);
  1942. !             return(2);
  1943.           }
  1944.           oldout = Fdup(1);
  1945.           (void)Fforce(1, outfd);
  1946. *** 1.1    1990/02/27 21:25:34
  1947. --- sysvar.c    1992/03/06 19:26:52
  1948. ***************
  1949. *** 1,7 ****
  1950.   #include <support.h>
  1951.   #include <osbind.h>
  1952.   
  1953. ! long get_sysvar(void *var)
  1954.   {
  1955.       long ret;
  1956.       long save_ssp;
  1957. --- 1,9 ----
  1958.   #include <support.h>
  1959.   #include <osbind.h>
  1960.   
  1961. ! long
  1962. ! get_sysvar(var)
  1963. !     void *var;
  1964.   {
  1965.       long ret;
  1966.       long save_ssp;
  1967. ***************
  1968. *** 15,21 ****
  1969.       return ret;
  1970.   }
  1971.   
  1972. ! void    set_sysvar_to_long(void *var, long val)
  1973.   {
  1974.       long save_ssp;
  1975.       
  1976. --- 17,26 ----
  1977.       return ret;
  1978.   }
  1979.   
  1980. ! void
  1981. ! set_sysvar_to_long(var, val)
  1982. !     void *var;
  1983. !     long val;
  1984.   {
  1985.       long save_ssp;
  1986.       
  1987. *** 1.6    1991/04/26 03:42:08
  1988. --- tmpnam.c    1992/03/06 19:26:55
  1989. ***************
  1990. *** 13,19 ****
  1991.   {
  1992.       char *tmpdir;
  1993.   
  1994. !     if (!buf && !(buf = malloc(L_tmpnam)))
  1995.           return NULL;
  1996.   
  1997.       if (!(tmpdir = getenv("TEMP")) && !(tmpdir = getenv("TMPDIR")))
  1998. --- 13,19 ----
  1999.   {
  2000.       char *tmpdir;
  2001.   
  2002. !     if (!buf && !(buf = (char *)malloc(L_tmpnam)))
  2003.           return NULL;
  2004.   
  2005.       if (!(tmpdir = getenv("TEMP")) && !(tmpdir = getenv("TMPDIR")))
  2006.